using System;
using System.Threading.Tasks;
using UwinEducation.Domain.Entities;
using UwinEducation.Shared.Models;

namespace UwinEducation.Domain.IRepositories
{
    public interface IUserRepository : IRepository<User, Guid>
    {
        /// <summary>
        /// 检查用户名是否存在
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <param name="excludeId">排除的用户ID</param>
        /// <returns>是否存在</returns>
        Task<bool> ExistsByUserNameAsync(string userName, Guid? excludeId = null);

        /// <summary>
        /// 获取用户分页列表
        /// </summary>
        /// <param name="pageRequest">分页请求参数</param>
        /// <returns>用户分页列表</returns>
        Task<PagedResult<User>> GetPagedListAsync(UserPageRequest pageRequest);

        /// <summary>
        /// 获取用户详情
        /// </summary>
        /// <param name="id">用户ID</param>
        /// <returns>用户详情</returns>
        Task<User> GetDetailsByIdAsync(Guid id);

        /// <summary>
        /// 获取用户的角色ID列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>角色ID列表</returns>
        Task<List<Guid>> GetRoleIdsAsync(Guid userId);
    }
}